package acm;

import java.util.*;

public class TuXingJiSuan
{
	Scanner scanner;
	
	double squire;
	double g[];
	
	double newSquire;
	double newG[];
	
	Index[] indexs = new Index[3];
	
	Index indexChanged;
	
	List<Index> list;
	
	String answer;
	
	public TuXingJiSuan()
	{
		scanner = new Scanner(System.in);
		
		g = new double[2];
		newG = new double[2];
		
		answer = "";
	}
	
	public void run()
	{
		int listNumber;
		
		for( listNumber = scanner.nextInt(); listNumber>0; listNumber--)
		{
			listFigure();
		}
		
		System.out.println(answer);
	}
	
	public void listFigure()
	{
		squire = 0;
		newSquire = 0;
		
		int i = 3;

		g[0] = g[1] = 0;
		
		list = new ArrayList<Index>();
		
		
		readNumber();
		
		
		indexs[0] = list.get(0);
		indexs[1] = list.get(1);
		indexs[2] = list.get(2);
		
		indexs[1].setNext(indexs[2]);
		indexs[2].setNext(indexs[1]);
		
		indexChanged = indexs[1];
		
		squireFigure();
		gFigure();
		
		getNewG();
		squire += newSquire;
		
		
		for ( ; i<list.size(); i++ )
		{
			indexChanged.reSet(list.get(i));
			indexChanged = indexChanged.next;
			
			squireFigure();
			gFigure();
			
			getNewG();
			squire += newSquire;
		}
		
		if (squire < 1e-9)
		{
			answer += "0.000 0.000\n";
		}
		else
		{
			answer += String.format("%.3f %.3f\n", squire, (g[0] + g[1]) / squire);
		}
	}
	
	private void readNumber()
	{
		for ( int i = scanner.nextInt(); i>0; i-- )
		{			
			list.add(new Index(scanner.nextDouble(), scanner.nextDouble()));
		}
		
		Index temp = list.remove(list.size() - 1);
		
		for ( Index i : list )
		{
			if ( i.x == temp.x && i.y == temp.y )
			{
				list = list.subList(list.indexOf(i), list.size());
			}
		}
		
		list.add(temp);
	}

	private void getNewG()
	{
		if ( newSquire != 0 )
		{
			g[0] += newG[0] * newSquire;
			g[1] += newG[1] * newSquire;
		}
	}

	private void gFigure()
	{
		newG[0] = indexs[0].x + indexs[1].x + indexs[2].x;
		newG[1] = indexs[0].y + indexs[1].y + indexs[2].y;
		
		newG[0] /= 3;
		newG[1] /= 3;
	}

	private void squireFigure()
	{
		newSquire = Math.abs(indexs[0].x * indexs[1].y + indexs[1].x * indexs[2].y + indexs[2].x * indexs[0].y - indexs[0].y * indexs[1].x - indexs[1].y * indexs[2].x - indexs[2].y * indexs[0].x ) / 2;
	}

	public static void main(String[] args)
	{
		TuXingJiSuan js = new TuXingJiSuan();
		
		js.run();
	}
	
	class Index
	{
		double x;
		double y;
		
		Index next;
		
		public Index(double x, double y)
		{
			this.x = x;
			this.y = y;
		}
		
		public Index(double x, double y, Index next)
		{
			this.x = x;
			this.y = y;
			this.next = next;
		}
		
		public Index getNext()
		{
			return next;
		}
		
		public void setNext(Index next)
		{
			this.next = next;
		}
		
		public void reSet(Index index)
		{
			this.x = index.x;
			this.y = index.y;
		}
	}
}
